import java.io.*;
public class text3 {
    public static void main(String[] args) throws IOException {
        File oddFile = new File("OddNnumber.txt");
        File evenfile = new File("EvenNnumber.txt");
        BufferedOutputStream odd_bufout = null;
        FileOutputStream odd_dataout = null;
        BufferedOutputStream even_bufout = null;
        FileOutputStream even_dataout = null;
        try {
            if (!oddFile.exists()) {
                oddFile.createNewFile();
            }
            if (!evenfile.exists()) {
                evenfile.createNewFile();
            }
            odd_dataout = new FileOutputStream(oddFile);
            odd_bufout = new BufferedOutputStream(odd_dataout);
            even_dataout = new FileOutputStream(evenfile);
            even_bufout = new BufferedOutputStream(even_dataout);
            for (int i = 0; i < 100; i++) {
                if (i % 2 == 0) {
                    String even = Integer.valueOf(i).toString() + "\t";
                    even_bufout.write(even.getBytes());
                }
                else {
                    String odd = Integer.valueOf(i).toString() + "\t";
                    odd_bufout.write(odd.getBytes());
                }
            }
        } catch (IOException e) {
            System.out.println(e);
        } finally {
            odd_bufout.close();
            odd_dataout.close();
            even_bufout.close();
            even_dataout.close();
        }
    }
}
